package com.tool.btn;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.MouseEvent;

import org.come.Frame.TtCjJframe;
import org.come.Jpanel.TtJpanel;
import org.come.until.FormsManagement;


public class TtOperationBtn
        extends MoBanBtn {
    private int caozuo;
    private TtJpanel ttJpanel;

    public TtOperationBtn(String iconpath, int type, int caozuo, TtJpanel ttJpanel) {
        super(iconpath, type);
        setVerticalTextPosition(0);
        setHorizontalTextPosition(0);
        setCaozuo(caozuo);
        setTtJpanel(ttJpanel);
    }


    public TtOperationBtn(String iconpath, int type, Color[] colors, String text, Font font, int caozuo, TtJpanel ttJpanel) {
        super(iconpath, type, colors);

        setText(text);
        setFont(font);
        setHorizontalTextPosition(0);
        setVerticalTextPosition(0);
        setCaozuo(caozuo);
        setTtJpanel(ttJpanel);
    }


    @Override
    public void chooseyes() {
    }


    @Override
    public void chooseno() {
    }


    @Override
    public void nochoose(MouseEvent e) {
        if (this.caozuo != 1) {
            if (this.caozuo == 5) {
                FormsManagement.showForm(607);
                TtCjJframe.getTtCjJframe().getPanel().initData();
            } else if (this.caozuo == 6) {
                FormsManagement.showForm(608);
            }
        }
    }

    public int getCaozuo() {
        return this.caozuo;
    }

    public void setCaozuo(int caozuo) {
        this.caozuo = caozuo;
    }

    public TtJpanel getTtJpanel() {
        return this.ttJpanel;
    }

    public void setTtJpanel(TtJpanel ttJpanel) {
        this.ttJpanel = ttJpanel;
    }
}


